package top.shiyiri.shops.controller;

import com.alibaba.fastjson.JSONObject;
import top.shiyiri.shops.bean.CateParTop10;
import top.shiyiri.shops.service.CateParTop10Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author Aunean
 * @date 2021/12/28
 */
@Controller
public class CateParTop10Controller {

    @Autowired
    private CateParTop10Service service;

    @RequestMapping("/catParTop10")
    @ResponseBody
    public String catParTop10() {

        List<CateParTop10> list = service.catParTop10();

        return JSONObject.toJSONString(list);
    }
}
